package booksys.Mhome;


import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.Map;

@Mapper
public interface HomeDao {

    @Select("select * from manager where ma_id = #{id}")
    Manager findManagerById(String userId);

    @Update("update manager set ma_avatar = #{avatar} where ma_id = #{uid}")
    void updateAvatar(@Param("uid") String userId, @Param("avatar") String filename);

    @Update("update manager set ma_name=#{userName},ma_sex=#{sex},ma_phone=#{phone},ma_mail=#{email} where ma_id = #{userId}")
    void updateManager(Map<String, Object> dto);

    @Update("update manager set ma_pwd=#{new} where ma_id = #{id}")
    void updatePassword(Map<String, Object> dto);
    @Select("select * from manager where ma_id = #{id} and ma_pwd=#{old}")
    Manager confirmPassword(Map<String, Object> dto);
}
